#ifndef TASKMANAGER_H
#define TASKMANAGER_H
#include <poolinfo.h>
#include <QObject>
#include <vector>

class TaskManager : public QObject
{
    Q_OBJECT
public:
    TaskManager();
    ~TaskManager();

    TaskInfo createTask(size_t memSize);
    void addTask(const TaskInfo& task);
    void batchUpdate();
    void removeTask(int taskId);
    void clearTaskList();
    std::vector<TaskInfo> getTaskList() const;
signals:
    void taskBatchAdded();
    void taskRemoved(int taskId);
    void taskListCleared();
private:
    std::vector<TaskInfo> m_taskList;
    static int nextTaskId;
};

#endif // TASKMANAGER_H
